<?php
$link = mysql_connect('localhost', 'root', '');
//$link = mysql_connect('aecabill.accountsupportmysql.com', 'aeca', 'fArC5YyyG8NT9wdC5LXP');
if (!$link) { 
     die('There appeared to be an error while connecting to the website database: ' . mysql_error()); 
}
mysql_select_db(aeca);
$user = $_POST['user'];
$query = "SELECT COUNT(*) FROM tbl_reporting_personnel WHERE rp_username = '$user'";
$data = mysql_query($query);
$res = mysql_fetch_row($data);
echo $res[0];
?>